package com.beijiteshop.shop.ui.order.adapter

import android.view.View
import com.beijiteshop.shop.R
import com.beijiteshop.shop.databinding.ItemRefundBinding
import com.beijiteshop.shop.model.entity.RefundEntity
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder

/**
 * @Author LiaoZhongKai
 * @Date 2021/3/18 16:42
 * @Description
 */
class OrderRefundAdapter(data: MutableList<RefundEntity>)
    : BaseQuickAdapter<RefundEntity,BaseDataBindingHolder<ItemRefundBinding>>(R.layout.item_refund,data) {

    override fun convert(holder: BaseDataBindingHolder<ItemRefundBinding>, item: RefundEntity) {
        holder.dataBinding?.let {
            it.refund = item
            //最后一个Item去掉垂直分割线
            it.refundVerticalDivider.visibility = if (holder.adapterPosition == data.size-1) View.GONE else View.VISIBLE
        }
    }


}